/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.javatrainning.hieptq.btvn2;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 *
 * @author Hiep
 */
public class Bai9 {
    public static void main(String[] args) throws FileNotFoundException, IOException {
        BufferedReader br=new BufferedReader(new FileReader("b9.txt"));
        String s=br.readLine();
        System.out.println("moi ban nhap xau: "+s);
        StringTokenizer st=new StringTokenizer(s);
        int max,i=1,length;
        max=st.nextToken().length();
        int vitri=i;
        while(st.hasMoreTokens()){
            length=st.nextToken().length();
            i++;
            if(max<length){
                max=length;
                vitri=i;
            }
            }
            System.out.println("do dai lon nhat xau la: "+max+" o vi tri: "+vitri);
        }
}
